Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Lock vs ReaderWriterLockSlim #4154

Closed
wants to merge 2 commits into from

Conversation

Mag-nus
Copy link
Member

@Mag-nus Mag-nus commented Apr 24, 2024

This is a rough test switching biota property get/set to be protected by a lock vs a readerwriterlockslim.

ReaderWriterLockSlim is more efficient when you have many readers vs seldom writers.

WIthout contention, Lock is ~5x more performant than ReaderWriterLockSlim.EnterReadLock

ACE current landblock group and threading model should result in minimal cases where multiple readers are accessing the same biota simultaneously, thus, lock may be the preferred choice.

This is a rough test switching biota property get/set to be protected by a lock vs a readerwriterlockslim.

ReaderWriterLockSlim is more efficient when you have many readers vs seldom writers.

WIthout contention, Lock is ~5x more performant than ReaderWriterLockSlim.EnterReadLock

ACE current landblock group and threading model should result in minimal cases where multiple readers are accessing the same biota simultaneously, thus, lock may be the preferred choice.
@Mag-nus
Copy link
Member Author

Mag-nus commented Apr 25, 2024

For clarification, after testing on .NET 8, performance is not 5x, but maybe 0.5x

@LtRipley36706
Copy link
Member

Closed and Reopened because the merge status was busted.

@Mag-nus Mag-nus closed this Apr 28, 2024
@Mag-nus Mag-nus deleted the LockvsReaderWriterLockSlim branch May 12, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants